﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DapperExtensions.Mapper;
using Newtonsoft.Json;
using ZilLion.Service.Core.Domain.EntityBase.JsonConverter;

namespace ZL.CRM.CommonEntity.AccOpr
{
    public class HouzhYwInfo
    {
        /// <summary>
        ///  业务流水号
        /// </summary>
        public string Oprywsno { get; set; }

        /// <summary>
        ///  业务明细流水号
        /// </summary>
        public string Oprywdrwsno { get; set; }

        /// <summary>
        ///  本地业务生效人id(员工id)
        /// </summary>
        public int Oprid { get; set; }

        /// <summary>
        ///  本地业务生效人名称
        /// </summary>
        public string Oprname { get; set; }

        /// <summary>
        ///  业务营业日
        /// </summary>
        [JsonConverter(typeof (ChinaDateTimeConverter))]
        public DateTime? Oprywdate { get; set; }

        /// <summary>
        ///  核算营业日
        /// </summary>
        [JsonConverter(typeof (ChinaDateTimeConverter))]
        public DateTime? Oprskywdate { get; set; }

        /// <summary>
        ///  核算机构id
        /// </summary>
        public int Oprskbrid { get; set; }

        /// <summary>
        ///  核算机构名称
        /// </summary>
        public string Oprskbrname { get; set; }

        /// <summary>
        ///  核算品牌id
        /// </summary>
        public int Oprskppid { get; set; }

        /// <summary>
        ///  核算品牌名称
        /// </summary>
        public string Oprskppname { get; set; }

        /// <summary>
        ///  业务界面名称。显示字段。
        /// </summary>
        public string Oprywwindow { get; set; }

        /// <summary>
        ///  业务单据号。显示字段。
        /// </summary>
        public string Oprywbno { get; set; }

        /// <summary>
        ///  业务摘要信息。显示字段。
        /// </summary>
        public string Oprsummary { get; set; }

    }
    public class HouzhYwInfoMapper : ClassMapper<HouzhYwInfo>
    {
        public HouzhYwInfoMapper()
        {
            Table("#YwInfo");
            Map(f => f.Oprywsno).Column("Oprywsno");
            Map(f => f.Oprywdrwsno).Column("Oprywdrwsno");
            Map(f => f.Oprid).Column("Oprid");
            Map(f => f.Oprname).Column("Oprname");
            Map(f => f.Oprywdate).Column("Oprywdate");
            Map(f => f.Oprskywdate).Column("Oprskywdate");
            Map(f => f.Oprskbrid).Column("Oprskbrid");
            Map(f => f.Oprskbrname).Column("Oprskbrname");
            Map(f => f.Oprskppid).Column("Oprskppid");
            Map(f => f.Oprskppname).Column("Oprskppname");
            Map(f => f.Oprywwindow).Column("Oprywwindow");
            Map(f => f.Oprywbno).Column("Oprywbno");
            Map(f => f.Oprsummary).Column("Oprsummary");

        }

    }
}
